package com.qyc.Microservice.dto.result;

import java.util.HashMap;
import java.util.Map;

//返回状态码
public enum ResultCode {

	/*  成功的状态	 */
	SUCCESS(1,"成功"),
	
	/*  参数错误 1001-1999	 */
	PARAM_IS_INVALID(1001,"参数无效"),
	PARAM_IS_BLANK(1002,"参数为空"),
	PARAM_TYPE_BIND_ERROR(1003,"参数类型错误"),
	PARAM_NOT_COMPLETE(1004,"参数缺失");
	
	
	
	private Integer status;
	private String message;

	ResultCode(Integer status,String message) {
		this.status = status;
		this.message = message;
	}

	public Integer status() {
		return this.status;
	}

	public String message() {
		return this.message;
	}

	public static Map<Integer, String> findAllEnum() {
		Map<Integer, String> map = new HashMap<Integer, String>();
		for (ResultCode resultCode : ResultCode.values()) {
			map.put(resultCode.status, resultCode.message);
		}
		return map;
	}

}
